#!/usr/bin/env python
# -*- coding: utf-8 -*-

#
# This program is free software; you can redistribute it and/or modify  
# it under the terms of the GNU General Public License as published by  
# the Free Software Foundation; either version 2 of the License, or     
# (at your option) any later version.                                   
#                                                                         
# A copy of the license can be found in the license.txt file supplied   
# with this software or at: http://www.gnu.org/copyleft/gpl.html       
#

import base64

import celtuce.yaml as yaml

#######################################################################

yaml_encode = yaml.dump
yaml_decode = yaml.load

#encode = yaml_encode
#decode = yaml_decode

#######################################################################

def encodeRouteTablet( obj ) :
    return base64.b64encode( yaml_encode( obj ) )
    ## encodeRouteTablet()

def decodeRouteTablet( obj ) :
    return yaml_decode( base64.b64decode( obj ) )
    ## decodeRouteTablet()

def encodeMeta( obj ) :
    return base64.b64encode( yaml_encode( obj ) )
    ## encodeMeta()

def decodeMeta( obj ) :
    return yaml_decode( base64.b64decode( obj ) )
    ## decodeMeta()


#######################################################################

import celtuce.help.phpserialize as phpserialize

encode = phpserialize.serialize
decode = phpserialize.unserialize

#######################################################################

import zlib 

compress = zlib.compress
decompress = zlib.decompress

#######################################################################

